<template>
  <div class="mod-config">
    <table-view ref="view"
                :searchAttrs="searchAttrs"
                :primaryKey="primaryKey"
                :listApiName="listApiName"
                :deleteApiName="deleteApiName"
                :exportApiName="exportApiName"
                :saveAuthName="saveAuthName"
                :deleteAuthName="deleteAuthName"
                :showAttrs="showAttrs"
    >
    </table-view>
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  </div>
</template>


<script>
import tableView from '@/components/tableView'
import basicMixins from '@/utils/commonViewMixins'
import AddOrUpdate from './commodityinfo-add-or-update'

export default {
  mixins: [basicMixins],
  data() {
    return {
      primaryKey: 'id',
      listApiName: 'commodityApi/listCommodityInfo',
      deleteApiName: 'commodityApi/deleteCommodityInfo',
      exportApiName: 'commodityApi/getCommodityInfoExport',
      saveAuthName: 'commodity:commodityinfo:save',
      deleteAuthName: 'commodity:commodityinfo:delete',
      searchAttrs: {
        commodityNo:{
          label: '商品编号',
          placeholder: '请输入商品编号'
        },
        productNo: {
          label: '光瓶编号',
          placeholder: '请输入光瓶编号'
        },
        productWeight: {
          label: '产品重量',
          placeholder: '请输入克重'
        },
        clientId: {
          label: '客户名称',
          clearable: true,
          type: 'autoComplete',
          placeholder: '请输入客户名称',
          querySearchApiName: 'clientApi/getClientList'
        },
      },
      showAttrs: {
        // commodityName: {
        //   label: '商品名称'
        // },
        commodityNo: {
          label: '商品编号'
        },
        bottleProductId: {
          label: '光瓶编号'
        },
        modelId: {
          label: '模具'
        },
        productWeight: {
          label: '克重'
        },
        productVolume: {
          label: '容量'
        },
        bottleOutDiameter: {
          label: '瓶口外径'
        },
        version: {
          label: '版本号'
        },
        bottleHeight: {
          label: '瓶高'
        },
        deepCategoryName: {
          label: '深加工'
        },
        bottleCapId: {
          label: '盖子'
        },
        bottleSprayHeadId: {
          label: '喷头'
        },
        centerCoverId: {
          label: '中套'
        },
        bottlePartId: {
          label: '肩套'
        },
        imagePath: {
          label: '商品图片'
        },
        clientId: {
          label: '客户'
        },
        commodityType: {
          label: '类别'
        },
        status: {
          label: '状态'
        },
        commodityPrice: {
          label: '商品价格'
        },
        remark: {
          label: '备注'
        }
      }
    }
  },
  components: {
    tableView,
    AddOrUpdate
  }
}
</script>
